package com.lemon.model;

import javax.persistence.*;
import java.sql.Timestamp;

@Entity
@Table(name = "T_Order", schema = "LemonDb", catalog = "")
public class OrderEntity {
    private int id;
    private String orderNo;
    private Timestamp orderCreatetime;
    private Timestamp orderUpdatetime;
    private Integer orderExpressId;
    private Integer visible;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "order_no")
    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    @Basic
    @Column(name = "order_createtime")
    public Timestamp getOrderCreatetime() {
        return orderCreatetime;
    }

    public void setOrderCreatetime(Timestamp orderCreatetime) {
        this.orderCreatetime = orderCreatetime;
    }

    @Basic
    @Column(name = "order_updatetime")
    public Timestamp getOrderUpdatetime() {
        return orderUpdatetime;
    }

    public void setOrderUpdatetime(Timestamp orderUpdatetime) {
        this.orderUpdatetime = orderUpdatetime;
    }

    @Basic
    @Column(name = "order_expressId")
    public Integer getOrderExpressId() {
        return orderExpressId;
    }

    public void setOrderExpressId(Integer orderExpressId) {
        this.orderExpressId = orderExpressId;
    }

    @Basic
    @Column(name = "visible")
    public Integer getVisible() {
        return visible;
    }

    public void setVisible(Integer visible) {
        this.visible = visible;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        OrderEntity that = (OrderEntity) o;

        if (id != that.id) return false;
        if (orderNo != null ? !orderNo.equals(that.orderNo) : that.orderNo != null) return false;
        if (orderCreatetime != null ? !orderCreatetime.equals(that.orderCreatetime) : that.orderCreatetime != null)
            return false;
        if (orderUpdatetime != null ? !orderUpdatetime.equals(that.orderUpdatetime) : that.orderUpdatetime != null)
            return false;
        if (orderExpressId != null ? !orderExpressId.equals(that.orderExpressId) : that.orderExpressId != null)
            return false;
        if (visible != null ? !visible.equals(that.visible) : that.visible != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (orderNo != null ? orderNo.hashCode() : 0);
        result = 31 * result + (orderCreatetime != null ? orderCreatetime.hashCode() : 0);
        result = 31 * result + (orderUpdatetime != null ? orderUpdatetime.hashCode() : 0);
        result = 31 * result + (orderExpressId != null ? orderExpressId.hashCode() : 0);
        result = 31 * result + (visible != null ? visible.hashCode() : 0);
        return result;
    }
}
